﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Barbar.UrlGuard.Dal {
  public class MonitoringEntryStatus {
    private int m_Value;
    private Color m_StatusColor;

    private MonitoringEntryStatus(int value, Color statusColor) {
      m_Value = value;
      m_StatusColor = statusColor;
    }

    public int Value {
      get { return m_Value; }
    }

    public Color StatusColor {
      get { return m_StatusColor; }
    }

    public static readonly MonitoringEntryStatus None = new MonitoringEntryStatus(0, Color.White);
    public static readonly MonitoringEntryStatus OK = new MonitoringEntryStatus(1, Color.LightGreen);
    public static readonly MonitoringEntryStatus Error = new MonitoringEntryStatus(2, Color.Red);

    public static MonitoringEntryStatus CreateFromHttpStatusCode(int statusCode) {
      if (statusCode == 0)
        return None;
      if (statusCode == 200)
        return OK;
      return Error;
    }
  }
}
